<body>
<?php include 'header.phtml';?>

</div>
<div class="AppContent GridView"><div id="MarketingBreadCrumbView" class="BreadCrumbView"><div class="breadcrumbs">
<a href="<?php echo $this->basePath();?>/marketing/">Marketing</a> &#47; <a href="<?php echo $this->basePath();?>/marketing/marketing/template">Templates</a> &#47; <span>Discount</span></div></div><div id="EmailTemplateEditAndDetailsView" class="SecuredEditAndDetailsView EditAndDetailsView DetailsView ModelView ConfigurableMetadataView MetadataView"><div class="details-table"><h1><span class="truncated-title"><span class="ellipsis-content">Discount</span></span></h1><div class="view-toolbar-container toolbar-mbmenu clearfix"><div class="view-toolbar"><ul class="options-menu nav">
<li class="parent last"><a href="javascript:void(0);"><span>Options</span></a>
<ul>
<li id="EditLinkActionElement"><a id="EditLinkActionElement-1-yt2" href="<?php echo $this->basePath();?>/marketing/marketing/templateedit"><span>Edit</span></a></li>
<li class="last"><a id="EmailTemplateDeleteLinkActionElement-1-yt3" href="/zurmo/app/index.php/emailTemplates/default/delete?id=1"><span>Delete</span></a></li>
</ul>
</li>
</ul></div></div>
<div class="left-column full-width"><div class="panel">
<table class="form-fields">
<colgroup>
<col class="col-0" />
<col class="col-1" />
</colgroup>
<tbody>

<?php  
$koneksi = mysql_connect("localhost", "root", "") or die("Gagal konek ke server.");  
mysql_select_db("zurmo") or die("Gagal membuka database."); 
?> 

<?php 
$query = "select * from emailtemplate";
$hasil = mysql_query($query, $koneksi) or die("Gagal melakukan query.");
$buff = mysql_fetch_array($hasil);
?>

<tr>
<th>Name</th>
<td colspan="1"><?php echo $buff['name']; ?></td>
</tr>

<tr>
<th>Subject</th>
<td colspan="1"><?php echo $buff['subject']; ?></td>
</tr>

<tr>
<th>Attachments</th>
<td colspan="1"></td>
</tr>

</tbody>
</table>
</div>

<div class="email-template-combined-content">
<th></th>
<td colspan="1"><div class="email-template-content">
<div class="tabs-nav"><a class="active-tab" href="#tab1">Text Content</a>
<a href="#tab2">Html Content</a></div> 
<div id="tab1" class="active-tab tab email-template-textContent"><?php echo $buff ['textcontent'];?></div>
<div id="tab2" class=" tab email-template-htmlContent">

<iframe src='/zurmo/app/index.php/emailTemplates/default/getHtmlContent?id=1' class='redactor-iframe' width='100%' height='100%' frameborder='0' seamless></iframe></div></div></td></div></div></div></div></div>
<div id="FlashMessageView"><div id = "FlashMessageBar"></div></div></div><div id="ModalContainerView"><div id="modalContainer"></div></div><div id="ModalGameNotificationContainerView"></div><div id="GameCoinContainerView"></div><div id="FooterView"><a href="http://www.zurmo.com" id="credit-link" class="clearfix"><span>Copyright &#169; Zurmo Inc., 2013. All rights reserved.</span></a><div class="ui-chooser"><a class="icon-mobile" href="/zurmo/app/index.php/zurmo/default/userInterface?userInterface=Mobile"><span>Show Mobile</span></a><a class="icon-desktop active" href="/zurmo/app/index.php/zurmo/default/userInterface?userInterface=Desktop"><span>Show Full</span></a></div></div></div></div></div><script type="text/javascript">
/*<![CDATA[*/

function closeGamificationDashboard(){
                           $('#UserGameDashboardView').remove();
                           $('body').removeClass('gd-dashboard-active');
                           $('#header-game-dashboard-link').html('∂').toggleClass('highlighted');
                       }
jQuery(function($) {

                    jQuery("body").ajaxComplete(
                        function(event, request, options)
                        {
                            if (request.responseText == "sessionTimeout")
                            {
                                $.cookie("sessionTimeoutCookie", 1,
                                        {
                                            expires : 1,
                                            path:  "/"
                                        });
                                window.location.reload(true);
                            }
                        }
                    );
                
$('#go-to-dashboard-link, #close-game-notification-link').click(function(event){
                           event.preventDefault();
                           $('#game-notification').fadeOut(300, function(){
                               $('#game-notification').remove();
                           });
                       });
                       $('.gd-dashboard-active').on('click', function(){
                           if($('#UserGameDashboardView').length){
                               closeGamificationDashboard();
                           }
                           return false;
                       });
$('body').on('click', '#header-game-dashboard-link', function(){jQuery.ajax({'beforeSend':function(){
                    if($("#UserGameDashboardView").length){
                        closeGamificationDashboard();
                        return false;
                    }
                    $("body").addClass("gd-dashboard-active");
                    $("#header-game-dashboard-link").html("‰").toggleClass("highlighted");
                },'success':function(data){$("#FooterView").after(data);},'url':'/zurmo/app/index.php/users/default/gameDashboard?id=1','cache':false});return false;});
  $(".nav li").hover(
    function () {
      if ($(this).hasClass("parent")) {
        $(this).addClass("over");
      }
    },
    function () {
      $(this).removeClass("over");
    }
  );

$("#globalSearchScope").bind("multiselectclick", function(event, ui){
                            if ($("#globalSearchScope").multiselect("widget").find(":checkbox:checked").length == 0)
                            {
                                $("#globalSearchScope").multiselect("widget").find(":checkbox").each(function(){
                                    if (this.value == "All" && !this.checked)
                                    {
                                        this.click();
                                    }
                                });
                            }
                            if (ui.value == "All" && ui.checked)
                            {
                                $("#globalSearchScope").multiselect("widget").find(":checkbox").each(function(){
                                    if (this.value != "All" && this.checked)
                                    {
                                        this.click();
                                    }
                                });
                            }
                            else if (ui.value != "All" && ui.checked)
                            {
                                $("#globalSearchScope").multiselect("widget").find(":checkbox").each(function(){
                                    if (this.value == "All" && this.checked)
                                    {
                                        this.click();
                                    }
                                });
                            }
                        });
                       
$('#globalSearchScope').multiselect({'selectedText':'','noneSelectedText':'','header':false,'position':{'my':'right top','at':'right bottom'}}); $(this).setupCheckboxStyling($('#globalSearchScope').parent())
$("#globalSearchInput").bind("focus", function(event, ui){
                            $("#globalSearchInput").autocomplete("option", "source", "/zurmo/app/index.php/zurmo/default/globalSearchAutoComplete?" + $.param($("#globalSearchScope").serializeArray()));
                        });
                       
jQuery('#globalSearchInput').autocomplete({'select': function(event, ui) {if (ui.item.href.length > 0){window.location = ui.item.href;} return false;},'search': function(event, ui) { $(this).makeOrRemoveTogglableSpinner(true, "#app-search") },'open': function(event, ui) { $(this).makeOrRemoveTogglableSpinner(false, "#app-search") },'position':{'my':'right top','at':'right bottom'},'source':'/zurmo/app/index.php/zurmo/default/globalSearchAutoComplete'});
 $("#globalSearchInput").data( "autocomplete" )._renderItem = function( ul, item ) {
                            return $( "<li></li>" ).data( "item.autocomplete", item )
                                    .append( "<a><span class=" + item.iconClass + "></span><span>" + item.label + "</span></a>" )
                                    .appendTo( ul );
                        };
$('body').on('click', '#yt0', function(){jQuery.ajax({'beforeSend':function(){
                jQuery('#modalContainer').html('');
                $(this).makeLargeLoadingSpinner(true, '#modalContainer');
                window.scrollTo(0, 0);
                jQuery('#modalContainer').dialog({
                    'title' : 'Create Task',
                    'autoOpen' : true,
                    'modal' : true,
                    'position' : 'center top+25',
                    'dialogClass' : 'task-dialog',
                    'height' : 'auto',
                    'open': function( event, ui )  { jQuery('#modalContainer').parent().addClass('openingModal'); },
                    'close': function( event, ui ) { jQuery('#modalContainer').parent().removeClass('openingModal');
                                                     $('#modalContainer').dialog('destroy');
                                                     
                                                     }
                });
                return true;
            },'url':'/zurmo/app/index.php/tasks/default/modalCreate?modalId=modalContainer','cache':false,'success':function(html){jQuery("#modalContainer").html(html)}});return false;});

                    $(function() {
                        $('.truncated-title').ThreeDots({ max_rows:1 });
                    });
jQuery('body').on('click','#EmailTemplateDeleteLinkActionElement-1-yt3',function(){return confirm('Are you sure you want to delete this email template?');});

                        $('.tabs-nav a:not(.simple-link)').click( function()
                        {
                            //the menu items
                            $('.active-tab', $(this).parent()).removeClass('active-tab');
                            $(this).addClass('active-tab');
                            //the sections
                            var _old = $('.tab.active-tab'); //maybe add context here for tab-container
                            _old.fadeToggle();
                            var _new = $( $(this).attr('href') );
                            _new.fadeToggle(150, 'linear', function()
                            {
                                    _old.removeClass('active-tab');
                                    _new.addClass('active-tab');
                            });
                            return false;
                        });
                    
});
/*]]>*/
</script>
</body>